package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.controller.request.JumpTypeRequest;
import com.sc.nft.controller.request.SignInRequest;
import com.sc.nft.entity.vo.SelfAmmunitionShowVO;
import com.sc.nft.entity.vo.SelfAmmunitionVO;
import com.sc.nft.pool.UserPool;
import com.sc.nft.service.SelfAmmunitionService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/selfAmmunition")
@Api(tags = "自弹活动引导图管理")
public class SelfAmmunitionController {

    private final SelfAmmunitionService selfAmmunitionService;

    @ApiOperation(value = "活动引导图", notes = "活动引导图", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/selfAmmunitionImg", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result<SelfAmmunitionShowVO> selfAmmunitionImg(@Valid @RequestBody JumpTypeRequest request)  {
        return Result.success(selfAmmunitionService.selfAmmunitionImg(request.getJumpType().getCode(), UserPool.getUser()));
    }


}
